all: add a "separator" style class
authorCosimo Cecchi <cosimoc@gnome.org>
Thu, 3 Mar 2011 03:55:25 +0000 (22:55 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Thu, 3 Mar 2011 22:48:26 +0000 (17:48 -0500)
gtk/gtkseparator.c
gtk/gtkseparatormenuitem.c
gtk/gtkseparatortoolitem.c
gtk/gtkstylecontext.h

index 687139fd4a092894562b4d8f8aed375ef3a7c144..66c18889f9c1ad8dd8705bcfe07c521c36194a4e 100644 (file)
@@ -101,6 +101,7 @@ static void
 gtk_separator_init (GtkSeparator *separator)
 {
   GtkSeparatorPrivate *private;
+  GtkStyleContext *context;
 
   separator->priv = G_TYPE_INSTANCE_GET_PRIVATE (separator,
                                                  GTK_TYPE_SEPARATOR,
@@ -110,6 +111,9 @@ gtk_separator_init (GtkSeparator *separator)
   gtk_widget_set_has_window (GTK_WIDGET (separator), FALSE);
 
   private->orientation = GTK_ORIENTATION_HORIZONTAL;
+
+  context = gtk_widget_get_style_context (GTK_WIDGET (separator));
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
 }
 
 static void
index b45873dbe7b84db77ce0b0bef90cfc47df5bf256..0a9569debe11e367bbd719a5e919568eb67dd0f2 100644 (file)
@@ -52,6 +52,10 @@ gtk_separator_menu_item_class_init (GtkSeparatorMenuItemClass *class)
 static void 
 gtk_separator_menu_item_init (GtkSeparatorMenuItem *item)
 {
+  GtkStyleContext *context;
+
+  context = gtk_widget_get_style_context (GTK_WIDGET (item));
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
 }
 
 /**
index be45120cca7b029348890d805c7eaf10c2b75105..90ecf92b8ed9ea7712cd759a080dfacde8ab5517 100644 (file)
@@ -152,12 +152,17 @@ gtk_separator_tool_item_class_init (GtkSeparatorToolItemClass *class)
 static void
 gtk_separator_tool_item_init (GtkSeparatorToolItem *separator_item)
 {
+  GtkStyleContext *context;
+
   separator_item->priv = G_TYPE_INSTANCE_GET_PRIVATE (separator_item,
                                                       GTK_TYPE_SEPARATOR_TOOL_ITEM,
                                                       GtkSeparatorToolItemPrivate);
   separator_item->priv->draw = TRUE;
 
   gtk_widget_set_has_window (GTK_WIDGET (separator_item), FALSE);
+
+  context = gtk_widget_get_style_context (GTK_WIDGET (separator_item));
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
 }
 
 static void
index b0a278ab91d68cf7d65c070d8ca86ac674b0330f..db196600e67ac75503361c107159b41912af1977 100644 (file)
@@ -401,6 +401,13 @@ struct _GtkStyleContextClass
  */
 #define GTK_STYLE_CLASS_PANE_SEPARATOR "pane-separator"
 
+/**
+ * GTK_STYLE_CLASS_SEPARATOR:
+ *
+ * A CSS class for a separator.
+ */
+#define GTK_STYLE_CLASS_SEPARATOR "separator"
+
 /**
  * GTK_STYLE_CLASS_INFO:
  *